package cn.attackme.myuploader.service.impl;

import cn.attackme.myuploader.dao.IndicatorDao;
import cn.attackme.myuploader.model.Indicator;
import cn.attackme.myuploader.service.IndicatorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class IndicatorServiceImpl implements IndicatorService {

    @Autowired
    private IndicatorDao indicatorDao;


    @Override
    public Indicator getIndicator(Long id) {
        return indicatorDao.getIndicator(id);
    }

    @Override
    public int save(Indicator indicator) {
        return indicatorDao.save(indicator);
    }

    @Override
    public int update(Indicator indicator) {
        return indicatorDao.update(indicator);
    }

    @Override
    public int delete(Long id) {
        return indicatorDao.deleteById(id);
    }

    @Override
    public List<Map<String, Object>> allList() {
        return indicatorDao.allList();
    }

    @Override
    public Indicator getIndicatorByName(String name) {
        return indicatorDao.getIndicatorByName(name);
    }
}
